import {page, pageFunc} from "../common/PageBuilder";
import {BasePage, BasePageData} from "../common/core/BasePage";
import {UserPage} from "../common/partPages/UserPage";
import {field} from "../../modules/coreModule/data/DataLoader";
import {AppConfig, appConfigRepo} from "../../modules/coreModule/data/AppConfig";
import {waitForDataLoad} from "../../modules/coreModule/managers/DataManager";
import {bannerRepo} from "../../modules/miscModule/data/Banner";
import {noticeRepo} from "../../modules/messageModule/data/Notice";

class Data extends BasePageData {
	@field(AppConfig)
	appConfig: AppConfig
}

@page("study", "资料学习")
export class StudyPage extends BasePage<Data> {

	data = new Data();

	/**
	 * 部分页
	 */
	public userPage: UserPage = new UserPage();

	onLoad(e) {
		super.onLoad(e);
		this.loadData().then()
	}

	@waitForDataLoad
	private loadData() {
		return this.setData({
			appConfig: appConfigRepo().data
		})
	}

	/**
	 * TODO:点击扫描二维码
	 */
	@pageFunc
	public scanQRCode() {

	}

}
